package cn.kgc.spring.entity;

import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author 课工场
 * @date 2024/2/20
 * @description
 */
public class MySqlConnection {

    public static void main(String[] args) throws SQLException {

        //  注册驱动
        Driver driver = new Driver();
        DriverManager.registerDriver(driver);

        String username = "root";
        String password = "root";
        String url = "jdbc:mysql:///java2323?useSSL=true";
        Connection connection = DriverManager.getConnection(url, username, password);
        System.out.println("connection = " + connection);

    }
}
